package lesson15;

public class Person 
{
	String name;
	int age;
	String personalNumber;
	char sex;
	double weight;
	Person friend;
	int health =50; // from 0 to 100
	int starvationStatus = 50; // from 0 to 100
	int mentalStatus = 50; // from 0 to 100
	boolean isMale;
	Person[] friends;
	double money;
	Car car;
	
	
	
	
	void buyCar(Car car)
	{
		if(this.money > car.price)
		{
			this.car = car;
		}
		car.changeOwner(this);
	}
	
	
	
	
	Person()
	{
		this.age = 0;
		this.weight = 4;
	}
	
	Person(String name, String personalNumber, boolean isMale)
	{
		this();
		this.name = name;
		this.personalNumber = personalNumber;
		this.isMale = isMale;
		friends = new Person[3];
		this.friends[0] = new Person();
		this.friends[1] = new Person();
		this.friends[2] = new Person();
	}
	
	
	
	
	Person(String personName, int personAge)
	{
		name = personName;
		age = personAge;
	}
	
	void eat(int foodVolume)
	{
		if(starvationStatus + foodVolume >= 100)
		{
			starvationStatus = 100;
		}
		else
		{
			starvationStatus +=foodVolume;
		}
		
	}
	
	void walk()
	{
		System.out.println(name + "is walking");
		starvationStatus-=5;
	}
	
	void growUp()
	{
		age++;
	}
	
	void dringWater(double litres)
	{
		System.out.println(name + " is drinking " + litres + "litres of water");
		starvationStatus +=litres;
	}
}
